<template>
  <div id="meeting">
    <el-container>
      <el-header>
        <p>绩效考核评估</p>
      </el-header>
      <el-main>
        <el-form ref="form1" :model="mydata" label-width="80px">
          <el-descriptions title="发起人信息" :column="2" border>
            <el-descriptions-item label="流水号"
              ><el-input v-model="mydata.num" disabled></el-input
            ></el-descriptions-item>
            <el-descriptions-item label="姓名"
              ><el-input v-model="mydata.name" disabled></el-input
            ></el-descriptions-item>
            <el-descriptions-item label="部门"
              ><el-input v-model="mydata.department_name" disabled></el-input
            ></el-descriptions-item>
            <el-descriptions-item label="岗位"
              ><el-input v-model="mydata.post_name" disabled></el-input
            ></el-descriptions-item>
            <el-descriptions-item label="发起时间"
              ><el-input v-model="mydata.int_ime" disabled></el-input
            ></el-descriptions-item>
            <el-descriptions-item label="考核周期"
              ><el-input v-model="mydata.nper" disabled></el-input
            ></el-descriptions-item>
          </el-descriptions>

          <el-descriptions title="绩效" :column="2" border>
            <el-descriptions-item label="绩效分数"
              ><el-input v-model="mydata.score"></el-input
            ></el-descriptions-item>
          </el-descriptions>
        </el-form>
        <div id="mybut">
          <el-button type="primary" @click="submit()">提交</el-button>
          <el-button type="info" @click="myreturn()">返回</el-button>
        </div>
      </el-main>
    </el-container>
  </div>
</template>
<script>
export default {
  data() {
    return {
      form: {
        name: "",
      },
      mydata: {},
    };
  },
  methods: {
    open3() {
      this.$message({
        message: "填写成功",
        type: "success",
      });
    },
    p(s) {
      return s < 10 ? "0" + s : s;
    },
    submit: function () {
      let x = new Date();
      let d = new Date();
      let resDate =
        d.getFullYear() +
        "-" +
        this.p(d.getMonth() + 1) +
        "-" +
        this.p(d.getDate());
      const resTime =
        this.p(d.getHours()) +
        ":" +
        this.p(d.getMinutes()) +
        ":" +
        this.p(d.getSeconds());
      this.$axios({
        url: "/personalcenter/performance/change",
        params: {
          perid: this.mydata.per_id,
          mytime: resDate + ` ` + resTime,
          score: this.mydata.score,
        },
      }).then((res) => {
        this.open3();
        this.$router.go(-1);
      });
    },
    myreturn: function () {
      this.$router.go(-1);
    },
  },
  mounted: function () {
    this.mydata = this.$store.state.Personalcenter.a;
    this.mydata.score = "";
  },
};
</script>
<style scoped lang='less'>
.el-main {
  padding: 20px 0 !important;
}
#meeting {
  width: 70%;
  margin: 20px auto;
  padding: 30px;
  border-radius: 5px;
}
.el-header {
  color: #666;
  text-align: center;
  line-height: 60px;
  p {
    font-weight: bold;
    font-size: 24px;
  }
}
.el-select {
  width: 100%;
}
#mybut {
  text-align: center;
  margin-top: 20px;
}
.el-date-editor {
  width: 100%;
}
.el-descriptions {
  margin-bottom: 20px !important;
}
</style>